package top.tupobi.flutterdemo


import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
import top.tupobi.flutterdemo.platform_view.AndroidPlatformViewFactory
import top.tupobi.flutterdemo.plugins.NativePluginForFlutter


class MainActivity : FlutterActivity() {
    override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
        // 第三方库生成的插件
        GeneratedPluginRegistrant.registerWith(flutterEngine)
        flutterEngine.plugins.add(FlutterNativePlugin())
        flutterEngine.plugins.add(NativePluginForFlutter())

        // platform view 注册
        flutterEngine.platformViewsController.registry.registerViewFactory("TestView", AndroidPlatformViewFactory(flutterEngine))
    }
}
